package com.lg.jvm.clazz;

/**
 * 研究局部变量表中 solt 的复用情况
 *
 * @author by gang.Li 2022/2/28 16:33
 */
public class LocalCariableTable {
    public static void foo() {
        // locals = 0 ,max_locals =0
        if (true) {
            // locals = 1 ,max_locals =1
            String a = "a";
        }
        // locals = 0 ,max_locals =1
        if (true) {
            // locals = 1 ,max_locals =1
            String b = "b";
        }
        // locals = 0 ,max_locals =1
    }

    public void foo2(){
        // stack=4, max_stack=4
            bar(1,2,3);
        // stack=2, max stack=4
            bar1(1);
        // stack=6, max_stack=6
            bar2(1,2,3,4,5);
    }

    private void bar2(int i, int i1, int i2, int i3, int i4) {
    }

    private void bar1(int i) {

    }

    private void bar(int i, int i1, int i2) {

    }
}